(module view mzscheme
  (provide srl-view%)
  
  (require (lib "mred.ss" "mred")
           (lib "class.ss")
           (lib "defmacro.ss")
           "input.ss"
           "output.ss"
           "graph.ss")
  
  (define +weekly-back+ (make-object bitmap% "images/graph-weekly.png" 'png #f))
  (define +weekly-label+ "Weekly Mileage")
  
  (define +total-back+ (make-object bitmap% "images/graph-total.png" 'png #f))
  (define +total-label+ "Total Mileage")
  
  (define srl-view%
    (class frame%
      (super-new)
      
      (define this-input (new srl-input% (parent this)))
      (define this-output (new srl-output% (parent this)))
      (define this-graph-box (new horizontal-pane% (parent this)))
      (define this-weekly-graph (new srl-graph% (parent this-graph-box)
                                     (label +weekly-label+)
                                     (background +weekly-back+)
                                     (min-width (send +weekly-back+ get-width))
                                     (min-height (send +weekly-back+ get-height))
                                     (x-scale (/ 270 52))
                                     (y-scale 1)))
      (define this-total-graph (new srl-graph% (parent this-graph-box)
                                    (label +total-label+)
                                    (background +total-back+)
                                    (min-width (send +total-back+ get-width))
                                    (min-height (send +total-back+ get-height))
                                    (x-scale (/ 270 52))
                                    (y-scale 10)))
      
      (define/public (input) this-input)
      (define/public (output) this-output)
      (define/public (weekly-graph) this-weekly-graph)
      (define/public (total-graph) this-total-graph))))
